

class AttrV2:
    def __init__(self):
        pass

    def add_relation(self, db, code, code_type, relation_id, attribute_name, order_tag):
        sql = "insert into relation_data_02 (Fsrc_code, Fsrc_type, Frelation_id, Fattribute_name, Forder_tag, Fcreate_time, Fmodify_time) values "
        sql += "('" + code + "'," + str(code_type) + "," + str(relation_id) + ",'" + attribute_name + "', " + str(order_tag) + ", now(), now());\n"
 
        print(sql)
        try:
            #pass
            db.execute_not_safe(sql)
        except Exception as e:
            print(str(e))
            pass


